# See LICENSE for license details.

.equ STACK_SIZE,   512

.globl _text_start
.globl _text_end
.globl _rodata_start
.globl _rodata_end
.globl _data_start
.globl _data_end
.globl _bss_start
.globl _bss_end
.global _memory_start;
.global _memory_end;

.section .text.init,"ax",@progbits
.globl _start

_start:
	nop
	# init bss data, as simulation environment requires
	la		a4, _bss_start
	la		a5, _bss_end
	li		a6, 0
bss_init:
	sw		a6, 0(a4)
	addi    a4, a4, 4
	bleu	a4, a5, bss_init

	li		t0, 0
    la      sp, stacks + STACK_SIZE
    add     sp, sp, t0

    j       main

    .bss
    .align 4
    .global stacks
stacks:
    .skip STACK_SIZE
